package com.zhb.designmode.structure.decorator.trytry;

public class CakeDecorator extends Cake {

    private Cake cake;
    //关键点：既要继承需要被修饰的类，还要去将它维护成自己的成员变量
    public CakeDecorator(Cake cake) {
        this.cake = cake;
    }

    protected String getMsg() {
        return this.cake.getMsg();
    }

    protected int getPrice() {
        return this.cake.getPrice();
    }
}
